package com.xlh.param.cases;

import com.fasterxml.jackson.annotation.JsonProperty;
import com.xlh.util.InputValidator;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.hibernate.validator.constraints.Length;
import org.hibernate.validator.constraints.NotBlank;

import javax.validation.constraints.Min;

/**
 * 创建行业参数
 * <p>
 * Created by lx on 2019/2/26.
 */
@Data
public class BusinessParam {

    @ApiModelProperty(value = "行业名称")
    @NotBlank(message = "行业名称不能为空")
    @Length(max = 20, message = "请正确填写行业名称，最多可输入20字符")
    @JsonProperty("businessCaseName")
    private String name;

    @ApiModelProperty(value = "行业图标id")
    @Min(value = 1, message = "请选择行业图标")
    @JsonProperty("businessCaseIconId")
    private Integer icon;

    public String getName() {
        return name == null ? null : InputValidator.regSpecialChar(name);
    }

}
